home *** CD-ROM | disk | FTP | other *** search
- class com.tmgc.gameconnector.GameConnectorAS2 extends MovieClip
- {
- var _localConnection;
- var _doofConnectionName = "doof";
- var _gameConnectionName = "game";
- function GameConnectorAS2()
- {
- super();
- var _loc7_ = unescape(this._url);
- var _loc9_ = _loc7_.lastIndexOf("?");
- var _loc8_ = _loc7_.substr(_loc9_ + 1,_loc7_.length);
- var _loc6_ = _loc8_.split("&");
- var _loc3_ = 0;
- while(_loc3_ < _loc6_.length)
- {
- var _loc5_ = _loc6_[_loc3_].split("=")[0];
- var _loc4_ = _loc6_[_loc3_].split("=")[1];
- if(_loc5_ == "doofConnectionName")
- {
- this._doofConnectionName = _loc4_;
- }
- if(_loc5_ == "gameConnectionName")
- {
- this._gameConnectionName = _loc4_;
- }
- _loc3_ = _loc3_ + 1;
- }
- this._localConnection = new LocalConnection();
- try
- {
- this._localConnection.connect(this.gameConnectionName);
- }
- catch(error:Error)
- {
- trace(error);
- }
- }
- function get doofConnectionName()
- {
- return this._doofConnectionName;
- }
- function get gameConnectionName()
- {
- return this._gameConnectionName;
- }
- function gameStarted(initialScore)
- {
- trace("GameConnectorAS2.gameStarted() initialScore=" + String(initialScore));
- this._localConnection.send(this.doofConnectionName,"gameStarted",initialScore);
- }
- function gameEnded(finalScore)
- {
- trace("GameConnectorAS2.gameEnded() finalScore=" + String(finalScore));
- this._localConnection.send(this.doofConnectionName,"gameEnded",finalScore);
- }
- function gameScore(score)
- {
- trace("GameConnectorAS2.gameScore() score=" + String(score));
- this._localConnection.send(this.doofConnectionName,"gameScore",score);
- }
- function gameStat(statName, statValue)
- {
- trace("GameConnectorAS2.gameStat() statName=" + statName + ", statValue=" + statValue);
- this._localConnection.send(this.doofConnectionName,"gameStat",statName,statValue);
- }
- function gameStatList(stats)
- {
- trace("GameConnectorAS2.gameStatList() stats=" + stats);
- this._localConnection.send(this.doofConnectionName,"gameStatList",stats);
- }
- function stopGame()
- {
- trace("GameConnectorAS2.stopGame()");
- }
- }
-